package org.jeecg.modules.qyxx.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
import org.jeecg.modules.qyxx.entity.BgHzNdYqsq;
import org.jeecg.modules.qyxx.entity.TycSwpj;
import org.jeecg.modules.qyxx.entity.req.BgNsrjbxxReq;
import org.jeecg.modules.qyxx.mapper.TycSwpjMapper;
import org.jeecg.modules.qyxx.service.ITycSwpjService;
import org.jeecg.modules.qyxx.util.DateUtils;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import java.util.List;

/**
 * @Description: 税务评级
 * @Author: zhujianjun
 * @Date:   2022-05-05
 * @Version: V1.0
 */
@Service
public class TycSwpjServiceImpl extends MppServiceImpl<TycSwpjMapper, TycSwpj> implements ITycSwpjService {

    @Override
    public List<TycSwpj> swpj(BgNsrjbxxReq req) {
        List<String> tjnds = DateUtils.getInstance().nearlyThreeYears(req.getKssj(),req.getJssj());
        String djxh = req.getDjxh();
        LambdaQueryWrapper<TycSwpj> wrapper = Wrappers.lambdaQuery(TycSwpj.class);
        wrapper.eq(TycSwpj::getShxydm,djxh).in(TycSwpj::getYear, tjnds);
        return super.list(wrapper);
    }
}
